package com.woniu.smart.service.impl;

import com.woniu.smart.entity.Room;
import com.woniu.smart.mapper.RoomMapper;
import com.woniu.smart.service.RoomService;
import com.woniu.smart.vo.NotRentedRoomVo;
import com.woniu.smart.vo.RoomVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author 晨星
 * @date 2022/10/21/21:10
 */
@Service
public class RoomServiceImpl implements RoomService {

    @Autowired
    private RoomMapper roomMapper;

    @Override
    public List<RoomVo> selectAll(Long id) {
        return roomMapper.selectAll(id);
    }

    @Override
    public List<NotRentedRoomVo> selectAllNotRented() {
        return roomMapper.selectAllNotRented();
    }

    @Override
    public int deleteByPrimaryKey(Long id) {
        return roomMapper.deleteByPrimaryKey(id);
    }

    @Override
    public int insertSelective(Room record) {
        return roomMapper.insertSelective(record);
    }

    @Override
    public Room selectByPrimaryKey(Long id) {
        return roomMapper.selectByPrimaryKey(id);
    }

    @Override
    public int updateByPrimaryKeySelective(Room record) {
        return roomMapper.updateByPrimaryKeySelective(record);
    }
}
